const state = {
  searchText: '' // 文本框输入的文字
}

const getters = {
  searchText: state => state.searchText
}

const actions = {
  fetchSearchText: ({
    commit,
    state
  }, text) => {
    commit('updateSearchText', text)
  }
}

const mutations = {
  updateSearchText: (state, payload) => {
    state.searchText = payload
  }
}

export default {
  state,
  getters,
  actions,
  mutations
}
